package com.rocketmq.temp3.rocketmq.consumer;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(
        topic = "sm-platform-topic",
        consumerGroup = "sm-platform-consumer",
        consumeMode = ConsumeMode.ORDERLY,
        consumeThreadMax = 1
)
public class MemberConsumer implements RocketMQListener<MessageExt> {
    @Override
    public void onMessage(MessageExt messageExt) {
        System.out.println(Thread.currentThread().getName() + ",队列" + messageExt.getQueueId() + "," + new String(messageExt.getBody()));
    }
}
